export class InputVector2 {
    x: number = 0;
    y: number = 0
    set(x: number, y: number) {
        this.x = x;
        this.y = y;
    }
}
export default class GameInputEvent {
    private _keyCode: number = 0;
    event: any;
    /**
     * 设置按键键值
    */
    public set keyCode(keyCode: number) {
        this._keyCode = keyCode;
    }
    /**
     * 获取按键键值
    */
    public get keyCode() {
        return this._keyCode;
    }
    /**
     * 键值是否包含指定按键
    */
    public isContainKeys(keys: number): boolean {
        return (this._keyCode & keys) == keys;
    }

    protected _pos: InputVector2 = new InputVector2();

    set pos(p: InputVector2) {
        if (!p) {
            return;
        }
        this._pos.set(p.x, p.y)
    }

    get pos() {
        return this._pos;
    }

    getLocation() {
        return this.pos;
    }
}

